<?php
if($this->input->cookie('search')){
	$searchData = $this->input->cookie('search');
	$str = explode("|",$searchData);
	if(count($str) >2){
		$default =array();
		$default['fieldSearch'] = $str[0];
		$default['textSearch'] = $str[1];
		$default['selCondition'] = $str[2];
	}
}
?><form  id="frmAdvancedNormal" name="frmAdvancedNormal" method="post" action="<?php echo @$this->url_search;?>" class="form-inline">
<div class="widget-box">
<div class="widget-title">
	<span class="icon"><i class="glyphicon glyphicon-search"></i></span>
	<h5>Tìm kiếm</h5>
</div>
<div class="widget-content  padding">
	<input  type="text" name="txtSearch" id="txtSearchAdvanced" value="<?php echo @$default['textSearch'];?>" style="width:300px;" placeholder="Chuỗi cần tìm..."class="input-small form-control input-small"  >
	
	<select name="selFieldSearch">
			<?php
			foreach ($datas as $keys => $vals) {
			$check = "";
			if(@$default['fieldSearch'] == $keys)
			{
				$check = " selected";
			}
			?>
			<option value="<?php echo $keys;?>" <?php echo $check;?>><?php echo $vals;?></option>
						  
			<?php
			}?>         
			</select> 
			<select name="selCondition">
			
			<option value="like" <?php echo (@$default['selCondition'] == 'like')?' selected':''?>>Gần đúng</option>
			<option value="=" <?php echo (@$default['selCondition'] != 'like')?' selected':''?>>Chính xác</option>
			</select>
		<input class="btn btn-primary btn-mini" type="submit" name="btnSearchAdvanced" id="btnSearchAdvanced" value="Tìm kiếm" />
			<a href="<?php echo $this->url_index;?>/clean_search" class="btn btn-default  btn-mini">Hiển thị tất cả</a>
</div>
</div>
</form>